#!/usr/bin/python3
# -*- coding: UTF-8 -*-
import requests
class Employee:
    # 所有员工的基类
    empCount = 0

    # heigth = 10
    # name = ""
    # salary = 0
    # _salary = 0 私有属性 下划线
    def __init__(self, name, salary):
        self.name = name
        self.salary = salary
        # Employee.empCount = Employee.empCount + 1
        Employee.empCount += 1
        # def __init__(self, name):
        #     self.name = name
        #
        # def __init__(self, salary):
        #     self.salary = salary

        # 打印员工总数
        # @staticmethod
        # @classmethod

    def displayCount(self):
        print('员工总数=' + self.name)
        # print
        # "Total Employee %d" % Employee.empCount

        # 呼叫员工的名字
        # 普通方法

    def callName(self):
        print("员工名字叫= " + self.name)

        # 普通方法
        # 呼叫员工的工资

    def callSalary(self):
        # print("员工的薪水= " + self.salary)
        print("员工的薪水%s:" % self.salary)

    #
    # (类方法)
    # @classmethod
    def callNameXX(cls):
        print("员工名字叫=111= " + cls.name)

        # 静态方法不需要传递self(自己)
        # @staticmethod  普通方法需要实例化   静态方法直接通过类名调用方法

    def displayEmployee(self):
        print('员工总数11111=')
    # def  displayEmployee (self):
    #    print "Name : ", self.name, ", Salary: ", self.salary
    def testData(self):
            # 接口的url
            url = "http://www.smallxzm.top:8888/tyb/live/selectImportantMessage"

            # 接口的参数
            params = {
                "from": "en",
                "to": "zh",
                "query": "test"
            }

            r = requests.request("get", url)

            # 打印返回结果
            print(r.text)


"创建 emp1 类的第一个对象"
# Employee.displayEmployee()
# emp1 = Employee("徐宗萌", 4545)
# emp1.displayEmployee()
# emp1.callNameXX()
# salaryxxx = emp1.salary
# emp1.salary = 8000
# print(emp1.salary)
# emp1.displayCount()
"创建 emp2 类的第二个对象"
# emp2 = Employee("唐艳艳", 5000)
# emp2.callName()
# emp2.callSalary()
